package JavaShengSai;

import java.util.Scanner;

/**
 * 1. 单词分析
 * https://www.lanqiao.cn/problems/504/learning/?problem_list_id=2&page=1&tag_relation=intersection&tags=2020
 */
public class Main1 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        char[] str = scan.next().toCharArray();
        int[] hash = new int[26];

        for(int i = 0;i < str.length;i++) {
            hash[str[i] - 'a']++;
            // 遍历str值，查看次数
        }

        char maxCh = 'a';
        int maxCount = 0;
        // 按字典序进行计算
        for(int i = 0;i < 26;i++) {
            if(hash[i] > maxCount) {
                maxCount = hash[i];
                maxCh = (char)(i + 'a');
            }
        }

        System.out.println(maxCh);
        System.out.println(maxCount);
        scan.close();
    }
}
